package com.zywl.utils.models;

import org.apache.poi.ss.formula.functions.T;

import java.util.List;

/**
 * @Author: xushixiang
 * @Date:
 * @Description:
 */
public class PageResult {
    private int code;
    private String msg;
    private int count;
    private List data;

    public PageResult error(String msg) {
        this.code = 0;
        this.msg = msg;
        return this;
    }

    public PageResult(long total, List<T> list) {
        this.count = (int) total;
        this.data = list;
        this.code = 0;
    }

    public PageResult(String msg,long total, List<T> list) {
        this.count = (int) total;
        this.data = list;
        this.code = 0;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public List getData() {
        return data;
    }

    public void setData(List data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
